﻿<ResourceDictionary 
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >

    <Style TargetType="{x:Type ProgressBar}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ProgressBar}">
                    <ControlTemplate.Resources>
                        <Storyboard x:Key="IndeterminateOn" RepeatBehavior="Forever">
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="IndeterminateGradientFill" Storyboard.TargetProperty="(Shape.Fill).(Brush.Transform).(TransformGroup.Children)[0].X" RepeatBehavior="Forever">
                                <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                                <SplineDoubleKeyFrame KeyTime="00:00:.5" Value="20"/>
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </ControlTemplate.Resources>
                    <Grid>

                        <Border x:Name="PART_Track" BorderThickness="1" CornerRadius="3" Opacity="0.825">
                            <Border.Background>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="#FFFFFFFF"/>
                                    <GradientStop Color="#FFD8D8D8" Offset="0.327"/>
                                    <GradientStop Color="#FFDADADA" Offset="0.488"/>
                                    <GradientStop Color="#FFBEBEBE" Offset="0.539"/>
                                    <GradientStop Color="#FFD6D6D6" Offset="0.77"/>
                                    <GradientStop Color="#FFFFFFFF" Offset="1"/>
                                </LinearGradientBrush>
                            </Border.Background>
                            <Border.BorderBrush>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="#FFBBBBBB" Offset="0"/>
                                    <GradientStop Color="#FF7E7E7E" Offset="1"/>
                                </LinearGradientBrush>
                            </Border.BorderBrush>
                        </Border>
                        <Grid x:Name="IndeterminateRoot" Visibility="Collapsed">
                            <Rectangle x:Name="IndeterminateSolidFill" Margin="1" Fill="#FF00C120" RadiusX="2" RadiusY="2"/>
                            <Rectangle x:Name="ProgressBarRootGradient" Margin="1" RadiusX="1.5" RadiusY="1.5" Panel.ZIndex="1">
                                <Rectangle.Fill>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#FFE8FFEC" Offset="0"/>
                                        <GradientStop Color="#84BDFFC9" Offset="0.516"/>
                                        <GradientStop Color="#00D6D6D6" Offset="0.521"/>
                                        <GradientStop Color="#FF7BFF94" Offset="1"/>
                                    </LinearGradientBrush>
                                </Rectangle.Fill>
                            </Rectangle>
                            <Rectangle x:Name="IndeterminateGradientFill" Margin="1" StrokeThickness="1" RadiusX="2" RadiusY="2" Opacity="0.7">
                                <Rectangle.Fill>
                                    <LinearGradientBrush EndPoint="0,1" StartPoint="20,1" MappingMode="Absolute" SpreadMethod="Repeat">
                                        <LinearGradientBrush.Transform>
                                            <TransformGroup>
                                                <TranslateTransform X="0"/>
                                                <SkewTransform AngleX="-10"/>
                                            </TransformGroup>
                                        </LinearGradientBrush.Transform>
                                        <GradientStop Color="#FF95FFA8" Offset="0.129"/>
                                        <GradientStop Color="#9159FF76" Offset="0.304"/>
                                        <GradientStop Color="#0007B324" Offset="0.498"/>
                                        <GradientStop Color="#8661FF7C" Offset="0.714"/>
                                        <GradientStop Color="#FF8BFFA1" Offset="0.949"/>
                                    </LinearGradientBrush>
                                </Rectangle.Fill>
                            </Rectangle>
                        </Grid>
                        <Grid x:Name="DeterminateRoot">
                            <Rectangle x:Name="PART_Indicator" Margin="1" RadiusX="1.5" RadiusY="1.5" HorizontalAlignment="Left" Opacity="0.83">
                                <Rectangle.Fill>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#FFE4FFDA" Offset="0"/>
                                        <GradientStop Color="#FFBDF4C0" Offset="0.198"/>
                                        <GradientStop Color="#FF9CEBAB" Offset="0.516"/>
                                        <GradientStop Color="#FF00C523" Offset="0.521"/>
                                        <GradientStop Color="#FF00D724" Offset="0.797"/>
                                        <GradientStop Color="#FF10DC2E" Offset="1"/>
                                    </LinearGradientBrush>
                                </Rectangle.Fill>
                            </Rectangle>
                        </Grid>
                        <Border x:Name="DisabledVisualElement" Background="#A5FFFFFF" BorderBrush="#59C0C0C0" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3" IsHitTestVisible="False" Visibility="Collapsed"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Visibility" TargetName="DisabledVisualElement" Value="Visible"/>
                        </Trigger>
                        <Trigger Property="IsIndeterminate" Value="True">
                            <Trigger.EnterActions>
                                <BeginStoryboard Storyboard="{StaticResource IndeterminateOn}"/>
                            </Trigger.EnterActions>
                            <Setter Property="Visibility" TargetName="IndeterminateRoot" Value="Visible"/>
                            <Setter Property="Visibility" TargetName="DeterminateRoot" Value="Collapsed"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>